
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.codeplex.wsitbt</groupId>
        <artifactId>wsit-build-tools-project</artifactId>
        <version>1.0.8-SNAPSHOT</version>
    </parent>

    <artifactId>wsit-ant-tasks-itest</artifactId>

    <name>WSIT Ant Tasks Integration Tests</name>
    <description>Integration Tests of WSIT Ant Tasks.</description>


    <build>
        <!-- filter the properties file with the current artifact info. -->
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>


        <plugins>
            <!-- currently not working without doing prior 'mvn install'
            see:
            http://jira.codehaus.org/browse/MENFORCER-42

            partial workaround by declaring in non-bundle sub-module poms.
            -->
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-versions</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requirePluginVersions />
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


            <!-- copy the task jar to a known location, for use by ant integration test itest-build.xml file. -->
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>wsit-ant-tasks</artifactId>
                                    <version>${project.version}</version>
                                </artifactItem>
                            </artifactItems>

                            <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>

                <!-- putting dependency on task project here avoid errors when running 'mvn clean package site' on fresh install. -->
                <dependencies>
                    <dependency>
                        <groupId>${project.groupId}</groupId>
                        <artifactId>wsit-ant-tasks</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                </dependencies>
            </plugin>


            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <!-- invoke ant using the itest-build.xml, which exercises the ant taskdefs -->
                        <configuration>
                            <target>
                                <ant antfile="${project.build.testOutputDirectory}/itest-build.xml" dir="${project.build.testOutputDirectory}" />
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
